package com.example.demo.str;

import cn.hutool.core.util.HexUtil;

/**
 * <pre>
 *  描述:
 * </pre>
 *
 * @author godelgnis(wujiaer)
 * @version 1.0.0
 * @date 2022/5/23 16:33
 */
public class StringTest {
    public static void main(String[] args) {
        String s = "佳儿";
        System.out.println(s.length());
        System.out.println(HexUtil.encodeHexStr(s.getBytes()).toUpperCase());
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            System.out.println(s.charAt(i));
            int ch = (int) s.charAt(i);
            String hexString = Integer.toHexString(ch);
            System.out.println(hexString);
            sb.append(hexString);
        }
        System.out.println(sb.toString().toUpperCase());
    }
}
